package cn.liulingfengyu.creationmode.factorypattern;

/**
 * 工厂模式示例
 */
public class FactoryPatternDemo {
    public static void main(String[] args) {
        // 使用工厂A创建产品A
        Factory factoryA = new ConcreteFactoryA();
        Product productA = factoryA.createProduct();
        productA.use();

        // 使用工厂B创建产品B
        Factory factoryB = new ConcreteFactoryB();
        Product productB = factoryB.createProduct();
        productB.use();
    }
}